package pkg;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Locale;
import java.util.Scanner;

/**
 * @author huangliusong
 * @since 2018/10/16
 * {@link }
 */
public class FileOperation {
    //读取文件名称为filename中的内容，并将其中包含的所有词语放入words中
    public static boolean readFile(String filename, ArrayList<String> words) throws FileNotFoundException {
        if(filename==null||words==null){
            System.out.println("filename is null or words is null");
            return false;
        }
        //文件读取
        Scanner scanner;
        File file=new File(filename);
        if (file.exists()){
            FileInputStream fis=new FileInputStream(file);
            scanner=new Scanner(new BufferedInputStream(fis));

            scanner.useLocale(Locale.ENGLISH);

        }else
            return false;

        return false;
    }
}
